package service

import (
	"github.com/sirupsen/logrus"
	"morleyStoneHome/dao"
	"morleyStoneHome/model"
)

//日志打印在service层处理
type newsService struct{}

var NewsService = newNewsService()

func newNewsService() *newsService {
	return &newsService{}
}

func (*newsService) ListAll(lan string) (all []model.News, err error) {
	all, err = dao.NewsDao.ListAll(lan)
	if nil != err {
		logrus.Error(err)
		return nil, err
	}
	return all, nil
}
func (*newsService) FindOne(id int, lan string) (one []model.News, err error) {
	one, err = dao.NewsDao.FindOne(id, lan)
	if nil != err {
		logrus.Error(err)
		return nil, err
	}
	return one, nil
}
